package org.spring.springboot.dubbo;

import com.alibaba.dubbo.config.annotation.Reference;
import org.spring.springboot.domain.City;
import org.springframework.stereotype.Component;

@Component
public class CityDubboConsumerService {

    @Reference(version = "1.0.0")
    CityDubboService cityDubboService;

    public void printCity() {
        try {
            String cityName = "温岭";
            City city = cityDubboService.findCityByName(cityName);
            System.out.println(city.toString());
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
    }
}
